package pers.jason.wppm.security.support;

import lombok.Data;
import org.springframework.social.connect.Connection;

/**
 * @ClassName: SocialUserInfo
 * @Author: JZH
 * @Date: 2018/12/2 21:11
 */
@Data
public class SocialUserInfo {

    public SocialUserInfo() {}

    public SocialUserInfo(Connection connection) {
        this.headImg = connection.getImageUrl();
        this.providerId = connection.getKey().getProviderId();
        this.providerUserId = connection.getKey().getProviderUserId();
        this.nickName = connection.getDisplayName();
    }

    private String providerId;

    private String providerUserId; //openId

    private String nickName;

    private String headImg;

}
